Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Peek] Update FilePreviewer to prevent tooltips from obscuring title bar controls #34718

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daverayment
Copy link
Contributor

Summary of the Pull Request

Update to prevent ImagePreview and VideoPreview controls' tooltips from obscuring the Main Window's title bar.

PR Checklist

Detailed Description of the Pull Request / Additional comments

When the user hovers over the top-right portion of an ImagePreview or VideoPreview, the associated tooltip is opened, with the text bound to InfoToolTip. This worked, but unfortunately the tooltip could obscure the Windows controls such as the close icon, which was an accessibility problem. This PR dynamically sets the Placement of the tooltip so it opens below the mouse pointer in the top portion of the previewers. The PointerMoved handler is generic, so will work with any future previewer which needs a tooltip.

The tooltips are proper child elements of the previewer controls now, as they need to be instantiated.

I updated the StringBuilder which appends the tooltip contents to have an initial capacity of 256 characters. This prevents the builder from resizing itself multiple times. This is a tiny perf/allocation improvement.

Validation Steps Performed

Manual tests only:

  • Tested with a mix of image and movie files.
  • Tested starting with a different previewer which doesn't use tooltips then navigating to an image or movie file which does need a tooltip.
  • Tested starting with an image or movie file then navigating to a different file type then opening another image or movie file.

@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Review This Pull Request awaits the review of a maintainer.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants